<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="fm" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'register.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/static/css/style.css" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">
		$(function(){
			//失去焦点
			$("#userCode").bind("blur",function(){
				alert("dsd");
				var userCodeValue=$("#userCode").val();
				/* 异步 */
				$.ajx({
					type:"GET",//请求类型
					url:"http://localhost:8080/smbsm_springjdbc/userCodeExit.html",//请求的路径
					data:{userCode:userCodeValue},//请求的参数 地址栏中？后的值
					dataType:"json",//返回（响应）的数据类型
					success:function(data){
						$("#userCodeMessage").html(data.userCode2)
						
						alert("成功"+data.userCode2);
					},
					error:function(){
						alert("失败");
					}
				})
			});
		});
	</script>
  </head>
  
  <body class="login_bg">
    <section class="loginBox">
        <header class="loginHeader">
            <h1>超市订单管理系统</h1>
        </header>
        <section class="loginCont">
	       <%--  <form class="loginForm" action="${pageContext.request.contextPath }/register"  name="actionForm" id="actionForm"  method="post" >
				<div class="info">${error }</div>
				<div class="inputbox">
                    <label for="user">用户名：</label>
					<input type="text" class="input-text" id="userCode" name="userCode" placeholder="请输入用户名" required/>
				</div>	
				<div class="inputbox">
                    <label for="mima">密码：</label>
                    <input type="password" id="userPassword" name="userPassword" placeholder="请输入密码" required/>
                </div>	
                <div class="inputbox">
                    <label for="day">生日：</label>
                    <input type="text" id="birthday" name="birthday" placeholder="请输入出生日期" required/>
                </div>
				<div class="subBtn">
					
                    <input type="submit" value="注册"/>
                    <input type="reset" value="重置"/>
                </div>	
			</form> --%>
			<!-- modelAttribute与 实体类对应   提交给来时的路径-->
			<fm:form method="post" modelAttribute="user" enctype="multipart/form-data">
				<!-- 获取错误 -->
				<!--错误提示在输入框的后面<fm:input path="userCode"/>&nbsp<fm:errors path="userCode"></fm:errors><br/>  -->
				<fm:errors path="userCode" id="userCodeMessage"></fm:errors><br/>
				<%-- 账号<fm:input path="userCode" id="userCode"/><br/> --%>
				<input type="text" class="input-text" id="userCode" name="userCode" placeholder="请输入用户名" required/>
				<span id="userCodeMessage"></span>
				<!-- 获取错误 -->
				<fm:errors path="userPassword" cssStyle="color:blue;"></fm:errors><br/>
				密码<fm:password path="userPassword"/><br/>
				生日<fm:input path="birthday"/><br/>
				<!-- 文件上传下载 -->
				文件<input type="file" name="imgName" />
				
				<input type="submit" value="注册"/>
                <input type="reset" value="重置"/>
			</fm:form>
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
        </section>
    </section>
</body>
</html>
